package com.jojo.bubble.service.impl;

import com.jojo.bubble.entity.Agent;
import com.jojo.bubble.dao.AgentDao;
import com.jojo.bubble.service.AgentService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

import javax.annotation.Resource;

/**
 * 代理商表(Agent)表服务实现类
 *
 * @author jojo
 * @since 2023-08-10 03:50:45
 */
@Service("agentService")
public class AgentServiceImpl implements AgentService {
    @Resource
    private AgentDao agentDao;

    @Override
    public int count(Agent record) {
        return this.agentDao.count(record);
    }

    @Override
    public int insert(Agent record) {
        return this.agentDao.insert(record);
    }

    @Override
    public int update(Agent record) {
        return this.agentDao.update(record);
    }

    @Override
    public Agent getInfo(int id) {
        return this.agentDao.queryById(id);
    }

    @Override
    public List<Agent> getList(Agent record) {
        return this.agentDao.getList(record);
    }

    @Override
    public List<Agent> queryAllByLimit(Agent record, Pageable pageable) {
        return this.agentDao.queryAllByLimit(record,pageable);
    }

    @Override
    public int delete(int id) {
        return this.agentDao.delete(id);
    }

    @Override
    public Agent queryByPhone(String phone) {
        return agentDao.queryByPhone(phone);
    }

    @Override
    public Agent queryByUser(Integer agentId) {
        return agentDao.queryByUser(agentId);
    }

    @Override
    public List<Agent> queryOverById(Integer id){
        return agentDao.queryOverById(id);
    }
}
